package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        String name = main.getName();
        System.out.println(name);


        long id = main.getId();
        System.out.println(id);


        int priority = main.getPriority();
        System.out.println("优先级"+priority);


        boolean isAlive = main.isAlive();//是否活着
        boolean isDaemon = main.isDaemon();//是否为守护线程
        boolean isInterrupted = main.isInterrupted();//是否被中断
        System.out.println("是否活着:"+isAlive);
        System.out.println("是否守护线程:"+isDaemon);
        System.out.println("是否被中断:"+isInterrupted);

    }
}
